The present invention relates to a control unit for controlling use of an external storage and, more particularly, to a control unit of an external storage for protecting data written to a defective location if a fault occurs in the external storage, a method for substituting a defective block, and a storage medium wherein a control program for substituting a defective block has been stored.
If reading data from an external storage of a magnetic disk device or the like fails due to some cause, there are some cases wherein the data is successfully and properly read on a retry of reading the data from the same block of a storage such as a magnetic disk. Although, however, the reading succeeded on the second try at that time, the block wherein such a reading failure has occurred may incur an uncorrectable fault and prevent data reading no matter how many times retry may repeated in the future, depending on the nature of a cause of the reading failure.
In conventional control of access to an external storage, even when reading data from a desired block failed, the block was considered to be free of faults and data was left stored in the unstable block if the reading was successfully performed on a retry. For this reason, the data stored in the block was lost if an uncorrectable fault occurs in the block.
As set forth above, the conventional control of access to an external storage has been presenting a shortcoming in that, even if reading data from a desired block fails, the block of the storage medium is regarded as normal if reading the data is successful on a retry, and the unstable block is left uncorrected; hence, the data recorded in the block is lost if a fault that cannot be corrected by retries on the block takes place.
It is therefore an object of the present invention to provide a control unit for an external storage, an access control method of controlling access to the external storage, and a storage medium recording a control program therein for controlling the access, that are capable of preventing loss of data if an uncorrectable fault occurs in a block when reading the data stored in the predetermined block on a storage medium fails, but reading the data is successful on a retry.
Other objects of the present invention will become clear as the description proceeds.
According to the present invention, there is provided a control unit for an external storage having a block in which a datum is recorded. The control unit comprises a data reading section connected to the external storage for reading the datum from the block, read monitoring means connected to the external storage for monitoring whether or not failure occurs in reading the datum from the block, and data control means connected to the external storage and the read monitoring means for controlling the datum to be recorded in the substitute block when the data reading section succeeds in reading the datum after occurrence of the failure.
According to the present invention, there is provided an access control method of controlling access to an external storage having a block in which a datum is recorded. The access control method comprises the steps of reading the datum from the block, monitoring whether or not failure occurs in reading the datum from the block, and controlling the datum to be recorded in a substitute block in response to success in reading the datum after occurrence of the failure.
According to the present invention, there is provided a storage medium in which a control program is recorded for controlling a data processor of a computer system as regards access to an external storage having a block recording a datum therein. The control program represents a method comprising the steps of reading the datum from the block, monitoring whether or not failure occurs in reading the datum from the block, and controlling the datum to be recorded in a substitute block in response to success in reading the datum after occurrence of the failure.